/*
 * File: SOPE.h
 *
 * Code generated for Simulink model 'SOPE'.
 *
 * Model version                  : 3.251
 * Simulink Coder version         : 9.4 (R2020b) 29-Jul-2020
 * C/C++ source code generated on : Tue Aug 29 15:13:24 2023
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: NXP->Cortex-M4
 * Code generation objective: MISRA C:2012 guidelines
 * Validation result: Not run
 */

#ifndef RTW_HEADER_SOPE_h_
#define RTW_HEADER_SOPE_h_
#include <stddef.h>
#ifndef SOPE_COMMON_INCLUDES_
#define SOPE_COMMON_INCLUDES_
#include "rtwtypes.h"
#endif                                 /* SOPE_COMMON_INCLUDES_ */

#include "SOPE_types.h"

/* Macros for accessing real-time model data structure */
#ifndef rtmGetErrorStatus
#define rtmGetErrorStatus(rtm)         ((rtm)->errorStatus)
#endif

#ifndef rtmSetErrorStatus
#define rtmSetErrorStatus(rtm, val)    ((rtm)->errorStatus = (val))
#endif

/* Block signals for system '<S6>/HeatCurr' */
typedef struct
{
    uint16_T HeatCurr_i;               /* '<S6>/HeatCurr' */
}
B_HeatCurr_SOPE_T;

/* Block states (default storage) for system '<S6>/HeatCurr' */
typedef struct
{
    uint8_T is_active_c2_SOPE;         /* '<S6>/HeatCurr' */
    uint8_T is_c2_SOPE;                /* '<S6>/HeatCurr' */
}
DW_HeatCurr_SOPE_T;

/* Block signals for system '<S26>/Subsystem1' */
typedef struct
{
    uint32_T Divide_g;                 /* '<S37>/Divide' */
}
B_Subsystem1_SOPE_T;

/* Block signals for system '<S26>/Transform' */
typedef struct
{
    uint32_T OutCur;                   /* '<S26>/Transform' */
}
B_Transform_SOPE_T;

/* Block states (default storage) for system '<S26>/Transform' */
typedef struct
{
    uint32_T speed;                    /* '<S26>/Transform' */
    uint32_T DesCur;                   /* '<S26>/Transform' */
    uint8_T is_active_c3_mylib;        /* '<S26>/Transform' */
    uint8_T is_c3_mylib;               /* '<S26>/Transform' */
    boolean_T flg;                     /* '<S26>/Transform' */
    boolean_T Finish;                  /* '<S26>/Transform' */
    boolean_T Initflg;                 /* '<S26>/Transform' */
}
DW_Transform_SOPE_T;

/* Block signals (default storage) */
typedef struct
{
    uint16_T sopv_ma_ChgReqCurr;       /* '<S6>/ChgCurr' */
    uint8_T Enable;                    /* '<S7>/Transform4' */
    uint8_T SChgReqStep;               /* '<S6>/ChgCurr' */
    B_Transform_SOPE_T sf_Transform_o; /* '<S35>/Transform' */
    B_Subsystem1_SOPE_T Subsystem1_h5; /* '<S35>/Subsystem1' */
    B_Transform_SOPE_T sf_Transform_c; /* '<S34>/Transform' */
    B_Subsystem1_SOPE_T Subsystem1_hk; /* '<S34>/Subsystem1' */
    B_Transform_SOPE_T sf_Transform_ij;/* '<S33>/Transform' */
    B_Subsystem1_SOPE_T Subsystem1_bg; /* '<S33>/Subsystem1' */
    B_Transform_SOPE_T sf_Transform_ae;/* '<S32>/Transform' */
    B_Subsystem1_SOPE_T Subsystem1_cm; /* '<S32>/Subsystem1' */
    B_Transform_SOPE_T sf_Transform_md;/* '<S31>/Transform' */
    B_Subsystem1_SOPE_T Subsystem1_a;  /* '<S31>/Subsystem1' */
    B_Transform_SOPE_T sf_Transform_m; /* '<S30>/Transform' */
    B_Subsystem1_SOPE_T Subsystem1_ga; /* '<S30>/Subsystem1' */
    B_Transform_SOPE_T sf_Transform_i; /* '<S29>/Transform' */
    B_Subsystem1_SOPE_T Subsystem1_h;  /* '<S29>/Subsystem1' */
    B_Transform_SOPE_T sf_Transform_a; /* '<S28>/Transform' */
    B_Subsystem1_SOPE_T Subsystem1_b;  /* '<S28>/Subsystem1' */
    B_Transform_SOPE_T sf_Transform_j; /* '<S27>/Transform' */
    B_Subsystem1_SOPE_T Subsystem1_c;  /* '<S27>/Subsystem1' */
    B_Transform_SOPE_T sf_Transform;   /* '<S26>/Transform' */
    B_Subsystem1_SOPE_T Subsystem1_g;  /* '<S26>/Subsystem1' */
    B_HeatCurr_SOPE_T sf_HeatCurr1;    /* '<S6>/HeatCurr1' */
    B_HeatCurr_SOPE_T sf_HeatCurr;     /* '<S6>/HeatCurr' */
}
B_SOPE_T;

/* Block states (default storage) for system '<Root>' */
typedef struct
{
    real_T OldBackParLim;              /* '<S7>/Transform4' */
    real_T OldDisParLim;               /* '<S7>/Transform4' */
    uint32_T DesCur;                   /* '<S15>/Chart' */
    uint32_T speed;                    /* '<S15>/Chart' */
    uint32_T count;                    /* '<S6>/ChgCurr' */
    uint16_T Init_Cnt;                 /* '<S7>/Transform4' */
    uint16_T SOCOld;                   /* '<S7>/Transform4' */
    uint16_T cnt;                      /* '<S7>/DisPwrDown2' */
    uint16_T celcnt;                   /* '<S7>/DisPwrDown2' */
    uint16_T ChgDownCurr;              /* '<S6>/ChgCurr' */
    uint8_T CellMaxTempOld;            /* '<S7>/Transform4' */
    uint8_T CellMinTempOld;            /* '<S7>/Transform4' */
    uint8_T is_active_c6_SOPE;         /* '<S7>/DisPwrDown2' */
    uint8_T is_c6_SOPE;                /* '<S7>/DisPwrDown2' */
    uint8_T is_active_c5_SOPE;         /* '<S15>/Chart' */
    uint8_T is_c5_SOPE;                /* '<S15>/Chart' */
    uint8_T is_active_c12_SOPE;        /* '<S6>/ChgCurr' */
    uint8_T is_SchgCurr;               /* '<S6>/ChgCurr' */
    boolean_T Finish;                  /* '<S15>/Chart' */
    boolean_T Initflg;                 /* '<S15>/Chart' */
    boolean_T flg;                     /* '<S15>/Chart' */
    DW_Transform_SOPE_T sf_Transform_o;/* '<S35>/Transform' */
    DW_Transform_SOPE_T sf_Transform_c;/* '<S34>/Transform' */
    DW_Transform_SOPE_T sf_Transform_ij;/* '<S33>/Transform' */
    DW_Transform_SOPE_T sf_Transform_ae;/* '<S32>/Transform' */
    DW_Transform_SOPE_T sf_Transform_md;/* '<S31>/Transform' */
    DW_Transform_SOPE_T sf_Transform_m;/* '<S30>/Transform' */
    DW_Transform_SOPE_T sf_Transform_i;/* '<S29>/Transform' */
    DW_Transform_SOPE_T sf_Transform_a;/* '<S28>/Transform' */
    DW_Transform_SOPE_T sf_Transform_j;/* '<S27>/Transform' */
    DW_Transform_SOPE_T sf_Transform;  /* '<S26>/Transform' */
    DW_HeatCurr_SOPE_T sf_HeatCurr1;   /* '<S6>/HeatCurr1' */
    DW_HeatCurr_SOPE_T sf_HeatCurr;    /* '<S6>/HeatCurr' */
}
DW_SOPE_T;

/* Invariant block signals (default storage) */
typedef struct
{
    const uint16_T Constant1;          /* '<S5>/Constant1' */
}
ConstB_SOPE_T;

/* Real-time Model Data Structure */
struct tag_RTM_SOPE_T
{
    const char_T * volatile errorStatus;
};

/* Block signals (default storage) */
extern B_SOPE_T SOPE_B;

/* Block states (default storage) */
extern DW_SOPE_T SOPE_DW;
extern const ConstB_SOPE_T SOPE_ConstB;/* constant block i/o */

/* Model entry point functions */
extern void SOPE_initialize(void);

/* Exported entry point function */
extern void TASK_SOP(void);

/* Real-time Model object */
extern RT_MODEL_SOPE_T *const SOPE_M;

/* Exported data declaration */

/* Declaration for custom storage class: ExportToFile */
extern uint8_T sopv_enum_QchgReqStep;  /* '<S5>/ChgCurrLimit' */
extern uint8_T sopv_enum_SchgReqStep;  /* '<S5>/ChgCurrLimit' */
extern uint16_T sopv_ma_BackCont;      /* '<S7>/Switch5' */
extern uint16_T sopv_ma_BackMax;       /* '<S5>/Constant1' */
extern uint16_T sopv_ma_BackPulse;     /* '<S7>/Switch4' */
extern uint16_T sopv_ma_ChgReqCur;     /* '<S15>/Chart' */
extern uint16_T sopv_ma_DsgCont;       /* '<S7>/Switch7' */
extern uint16_T sopv_ma_DsgMax;        /* '<S7>/DisPwrDown2' */
extern uint16_T sopv_ma_DsgPulse;      /* '<S7>/Switch2' */
extern uint16_T sopv_mv_ChgReqVol;     /* '<S6>/Switch1' */

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/block_name, where system is the system number (uniquely
 * assigned by Simulink) and block_name is the name of the block.
 *
 * Use the MATLAB hilite_system command to trace the generated code back
 * to the model.  For example,
 *
 * hilite_system('<S3>')    - opens system 3
 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : 'SOPE'
 * '<S1>'   : 'SOPE/DocBlock'
 * '<S2>'   : 'SOPE/Interface'
 * '<S3>'   : 'SOPE/LoadEnvironment1'
 * '<S4>'   : 'SOPE/Model Info'
 * '<S5>'   : 'SOPE/Interface/SOPCal'
 * '<S6>'   : 'SOPE/Interface/SOPCal/ChgCurrLimit'
 * '<S7>'   : 'SOPE/Interface/SOPCal/Subsystem'
 * '<S8>'   : 'SOPE/Interface/SOPCal/ChgCurrLimit/ChgCurr'
 * '<S9>'   : 'SOPE/Interface/SOPCal/ChgCurrLimit/Compare To Constant1'
 * '<S10>'  : 'SOPE/Interface/SOPCal/ChgCurrLimit/Compare To Constant2'
 * '<S11>'  : 'SOPE/Interface/SOPCal/ChgCurrLimit/Compare To Constant3'
 * '<S12>'  : 'SOPE/Interface/SOPCal/ChgCurrLimit/Compare To Constant4'
 * '<S13>'  : 'SOPE/Interface/SOPCal/ChgCurrLimit/HeatCurr'
 * '<S14>'  : 'SOPE/Interface/SOPCal/ChgCurrLimit/HeatCurr1'
 * '<S15>'  : 'SOPE/Interface/SOPCal/ChgCurrLimit/Subsystem'
 * '<S16>'  : 'SOPE/Interface/SOPCal/ChgCurrLimit/Subsystem/Chart'
 * '<S17>'  : 'SOPE/Interface/SOPCal/Subsystem/Compare To Constant1'
 * '<S18>'  : 'SOPE/Interface/SOPCal/Subsystem/Compare To Constant10'
 * '<S19>'  : 'SOPE/Interface/SOPCal/Subsystem/Compare To Constant2'
 * '<S20>'  : 'SOPE/Interface/SOPCal/Subsystem/Compare To Constant3'
 * '<S21>'  : 'SOPE/Interface/SOPCal/Subsystem/Compare To Constant4'
 * '<S22>'  : 'SOPE/Interface/SOPCal/Subsystem/Compare To Constant6'
 * '<S23>'  : 'SOPE/Interface/SOPCal/Subsystem/Compare To Constant8'
 * '<S24>'  : 'SOPE/Interface/SOPCal/Subsystem/Compare To Constant9'
 * '<S25>'  : 'SOPE/Interface/SOPCal/Subsystem/DisPwrDown2'
 * '<S26>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit'
 * '<S27>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit1'
 * '<S28>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit2'
 * '<S29>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit3'
 * '<S30>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit4'
 * '<S31>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit5'
 * '<S32>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit6'
 * '<S33>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit7'
 * '<S34>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit8'
 * '<S35>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit9'
 * '<S36>'  : 'SOPE/Interface/SOPCal/Subsystem/Transform4'
 * '<S37>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit/Subsystem1'
 * '<S38>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit/Transform'
 * '<S39>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit1/Subsystem1'
 * '<S40>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit1/Transform'
 * '<S41>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit2/Subsystem1'
 * '<S42>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit2/Transform'
 * '<S43>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit3/Subsystem1'
 * '<S44>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit3/Transform'
 * '<S45>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit4/Subsystem1'
 * '<S46>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit4/Transform'
 * '<S47>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit5/Subsystem1'
 * '<S48>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit5/Transform'
 * '<S49>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit6/Subsystem1'
 * '<S50>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit6/Transform'
 * '<S51>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit7/Subsystem1'
 * '<S52>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit7/Transform'
 * '<S53>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit8/Subsystem1'
 * '<S54>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit8/Transform'
 * '<S55>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit9/Subsystem1'
 * '<S56>'  : 'SOPE/Interface/SOPCal/Subsystem/PwrTabLimit9/Transform'
 */

/*-
 * Requirements for '<Root>': SOPE
 */
#endif                                 /* RTW_HEADER_SOPE_h_ */

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
